package com.lst.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lst.api.vo.ApplyInfoVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import com.lst.tools.mybatis.entity.DeleteBaseModel;

/**
 * 借款数据信息表
 *
 * @author Frank
 * @date 2019-12-30 10:31:37
 * @version: V1.0
 */
@Data
@NoArgsConstructor
@TableName(value = "lst_apply_info")
@ApiModel(value = "借款数据信息表")
public class ApplyInfo extends DeleteBaseModel {

    public static final String APPLY_NO = "apply_no";
    public static final String PROMO_USER_ID = "promo_user_id";
    public static final String APPLY_TYPE = "apply_type";
    public static final String LOAN_PURPOSE_ID = "loan_purpose_id";
    public static final String LOAN_PURPOSE_OTHER = "loan_purpose_other";

    @ApiModelProperty(name = "applyNo", value = "申请编号", dataType = "String")
    @TableField(value = APPLY_NO)
    private String applyNo;

    @ApiModelProperty(name = "promoUserId", value = "推销员用户id", dataType = "Long")
    @TableField(value = PROMO_USER_ID)
    private Long promoUserId;

    @ApiModelProperty(name = "applyType", value = "申请类型   1:个人   2:企业", dataType = "String")
    @TableField(value = APPLY_TYPE)
    private String applyType;

    @ApiModelProperty(name = "loanPurposeId", value = "用途id", dataType = "Long")
    @TableField(value = LOAN_PURPOSE_ID)
    private Long loanPurposeId;

    @ApiModelProperty(name = "loanPurposeOther", value = "其他用途", dataType = "String")
    @TableField(value = LOAN_PURPOSE_OTHER)
    private String loanPurposeOther;

    public ApplyInfo(long userId, String applyNo, ApplyInfoVo applyInfoVo) {
        this.applyNo = applyNo;
        this.promoUserId = userId;
        this.applyType = applyInfoVo.getApplyType();
        this.loanPurposeId = applyInfoVo.getLoanPurposeId();
        this.loanPurposeOther = applyInfoVo.getLoanPurposeOther();
    }
}